#ifndef __HIKARI_playerScript___FILE__DEFINED
#define __HIKARI_playerScript___FILE__DEFINED

#include "hikari.h"

class playerScript:public BaseHikariScript{
public:
//PLEASE DO NOT MODIFY THIS SECTION
//PROPERTIES_SECTION_START
//PROPERTIES_SECTION_END
    virtual void sceneLoaded(HObj*object, HikariContext*context){
		object->animate(L"idle");
	}
	//virtual void sceneUnloading(HObj*object, HikariContext*context){}
	virtual void update(HObj*object, HikariContext*context){
		if(context->getInput()->IsKeyPressed(KEY_UP)){
			object->animate(L"walk");
		}else if(context->getInput()->IsKeyReleased(KEY_UP)){
			object->animate(L"idle");
		}
		if(context->getInput()->IsKeyDown(KEY_UP)){
			object->moveRigidBodyZ(0.4f);
		}

		if(context->getInput()->IsKeyDown(KEY_DOWN)){
			object->moveRigidBodyZ(-0.4f);
		}

		if(context->getInput()->IsKeyDown(KEY_LEFT)){
			object->turnRigidBodyY(-4);
		}

		if(context->getInput()->IsKeyDown(KEY_RIGHT)){
			object->turnRigidBodyY(4);
		}
	}

	IMPLEMENT_RTTI(playerScript, BaseHikariScript);
};
BEGIN_REFLECTION_METADATA(playerScript, base_rtti_object)
END_REFLECTION_METADATA(playerScript)
#endif